# -*- coding:utf-8 -*-
import tree
import draw
import json

fr = open(file='loan-application.txt', encoding='utf-8')

data = [inst.strip().split(' ') for inst in fr.readlines()]
label = ['年龄', '有工作', '有自己的房子', '信贷情况']

Trees = tree.create_tree(data, label)
print(Trees)

draw.draw_tree(Trees)
